using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using App.Models;

namespace App.Controllers
{
    public class HomeController : Controller
    {
        private IAppRepository repository = null;

        public HomeController()
        {
            repository = new AppRepository();
        }

        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";

            //AppDataContext db = new AppDataContext();
            var gameType = from g in repository.GetGames()
                           where g.GameType == 1
                           select g;

            return View(gameType);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
